from fastapi import APIRouter, Request
from utils import create_json_response

router = APIRouter()

@router.post("/message/menu")
async def get_message_menu(request: Request):
    """自定义菜单接口 - 返回演示菜单数据"""
    
    # 演示菜单数据
    menu_data = [
        {
            "name": "审批指南",
            "app": "https://demo.example.com/__UNI__A32122A.wgt"
        },
        {
            "name": "审批记录",
            "app": "https://demo.example.com/records"
        },
        {
            "name": "快捷入口",
            "app": "",  # 这里一定要为空值
            "children": [
                {
                    "name": "请假申请",
                    "app": "https://demo.example.com/__UNI__53832368.wgt"
                },
                {
                    "name": "出差申请",
                    "app": "app://two"
                },
                {
                    "name": "快速报销",
                    "app": "app://one"
                }
            ]
        }
    ]
    
    return create_json_response(menu_data)
